import random

p = 41


pstr=str(p)
c = ''
cint = ''
def getGuess():
    while True:
        print('מה התשובה')
        c = input()
        
       
        
            
        if c not in '123456789101112131415161718192021222324252627282930':
            if c != 'לא':
                print('בבקשה תקישי מיספר עד 30')

            if c == 'לא':
                return c
        else:
            cint = int(c)
            return cint



while p > 0 and cint != 'ל' or cint != 'לא' and p <= 20:

    if p >= 20:
        break
        

    a = random.randint(1, 10)
    b = random.randint(1, 10)
    astr = str(a)
    bstr = str(b)
    print(astr + '+' + bstr +'=?')

    cint = getGuess()

    
    

    if cint == a + b:
        print('נכון')
        p = p + 2
        pstr=str(p)

    if cint != a + b:
        print('לא נכון')
        p = p - 2
        pstr=str(p)
        
    print('יש לך '+pstr+' נקודות')

    
    

while p > 0 and cint != 'לא' and p > 20 and p < 40:

    if p >= 40:
        break

    a = random.randint(1, 10) + 3
    b = random.randint(1, 10) + 5
    astr = str(a)
    bstr = str(b)
    print(astr + '+' + bstr +'=?')

    cint = getGuess()
    

    if cint == a + b:
        print('נכון')
        p = p + 2
        

    if cint != a + b:
        print('לא נכון')
        p = p - 2
        
    pstr=str(p)
    print('יש לך '+pstr+' נקודות')
    
while p > 0 and cint != 'לא' and p > 40 and p < 60:

    if p >= 60:
        break

    a = random.randint(1, 10) + 3
    b = random.randint(1, 10) + 5
    astr = str(a)
    bstr = str(b)

    if a > b:
        print(astr + '-' + bstr +'=?')

    if a < b:
        print(bstr + '-' + astr +'=?')

    cint = getGuess()
    

    if a > b and cint == a - b:
        p = p + 2
        print('נכון')

    if a > b and cint != a - b:
        p = p - 2
        print('לא נכון')

    if a < b and cint == b - a:
        p = p + 2
        print('נכון')

    if a < b and cint != b - a:
        p = p - 2
        print('לא נכון')

    pstr=str(p)
    print('יש לך '+pstr+' נקודות')

while p > 60:
    a = random.randint(-12, 19) + 12
    b = random.randint(1, 25) + 15
    astr = str(a)
    bstr = str(b)

    if a > b:
        print(astr + '-' + bstr +'=?')

    if a < b:
        print(bstr + '-' + astr +'=?')

    c = input()
    cint=int(c)

    if a > b and cint == a - b:
        p = p + 2
        print('נכון')

    if a > b and cint != a - b:
        p = p - 2
        print('לא נכון')

    if a < b and cint == b - a:
        p = p + 2
        print('נכון')

    if a < b and cint != b - a:
        p = p - 2
        print('לא נכון')

    pstr=str(p)
    print('יש לך '+pstr+' נקודות')

    
 
